1. Field of the Invention
This invention relates to a programable controller, and more particularly, to a programable controller which allows a flexible setting of a cycle time for one round of execution of a series of processing routines.
2. Discussion of the Related Art
In a conventional programable controller (PC), for example, a scanning-type PC, a series of processing routines including at least an input/output (I/O) refreshing routine and user programs are repeatedly executed by a microprocessor to perform various control functions. The series of processing routines can include, for example, a common routine, a PC linking routine, a host linking routine and a tool routine besides the I/O refreshing routine and the user programs.
As is well known, the execution time of the user programs fluctuates depending on the total program size and the states of the I/O ports during the execution of the programs. Accordingly, the total execution time, or cycle time, required for one round of execution of the series of processing routines also fluctuates. This fluctuation of the cycle time also results in a fluctuation in the starting time of the execution of the I/O refreshing routine. Consequently, machines to be controlled by I/O data supplied by the PCs during the I/O refreshing routine cannot be precisely controlled. To obtain a stable starting time of the I/O refreshing routine, the clock frequency of the PCs can be increased or decreased to obtain a constant cycle time. However, this approach raises another problem in that the execution speed of the user programs changes which can affect the various functions controlled by the controllers.